package cn.shujuhai.workflow.controller.flow;

import cn.shujuhai.common.domain.PageRequest;
import cn.shujuhai.common.pluging.data.ResultVo;
import cn.shujuhai.workflow.service.flow.ProcessDeployService;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: ZhangDeZhong
 * @Date: 2025/3/18 16:19
 * @Description:
 **/

@RestController
@RequestMapping("/workflow/processDeploy")
@RequiredArgsConstructor
public class ProcessDeployController {

    private final ProcessDeployService processDeployService;

    /**
     * 分页查询流程部署列表
     */
    @GetMapping("/processDeployList")
    public ResultVo<?> getProcessList(@Valid PageRequest pageRequest) {
        return this.processDeployService.processDeployList(pageRequest.getPageNum(), pageRequest.getPageSize());
    }

    /**
     * 分页查询流程部署列表
     */
    @PostMapping("/enable/{id}")
    public ResultVo<?> enable(@PathVariable String id) {
        return this.processDeployService.enable(id);
    }


}
